# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from wlapps.utils.sync_fields import sync_slugs


# 更新时额外操作的函数
def save_signal_func(sender, **kwargs):
    patch = kwargs['instance']
    # 更新slug，加入id和随机数，防抓取并保证唯一性
    sync_slugs(patch.pk, 'article', 'articlepost')
